import {Navigate, createHashRouter} from "react-router-dom";
import NotFond from "@/pages/NotFond/NotFond";
import Search from "@/pages/Search/Search";
import SearchGoods from "@/pages/SearchGoods/SearchGoods";
import GoodsDetail from "@/pages/GoodsDetail/GoodsDetail";

export const routePath = {
    search: "/search",
    searchGoods: "/searchGoods",
    goodsDetail: "/goodsDetail",
    notFond: "/NotFond",
};

export default createHashRouter([
    {
        path: routePath.search,
        element: <Search />,
    },
    {
        path: routePath.searchGoods,
        element: <SearchGoods />,
    },
    {
        path: routePath.goodsDetail,
        element: <GoodsDetail />,
    },
    {
        path: routePath.notFond,
        element: <NotFond />,
    },
    {
        path: "*",
        element: <Navigate to="/NotFond" replace />,
    },
]);
